package com.eden.data;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.annotation.MapperScans;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@Slf4j
@EnableDiscoveryClient
@SpringBootApplication
@MapperScans({
        @MapperScan("com.eden.eden.mapper")
})
@EnableTransactionManagement
public class DataBootstrap {

    public static void main(String[] args) {
        Long start = System.currentTimeMillis();
        ConfigurableApplicationContext context = new SpringApplicationBuilder()
                .sources(DataBootstrap.class)
                .web(WebApplicationType.SERVLET)
                .run(args);
        Long end = System.currentTimeMillis();
        log.info("mange server start cost time = {}s",(end-start)/1000);
    }
}
